/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-01-12 09:35:49
 * @LastEditTime : 2023-05-05 14:52:51
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Modal\TwoModalList\ProjectFormItemValue.jsx
 * @Description  :
 */

import { API_LIST } from '../../Api/Api'
import { TwoAddBtn } from '../options'
import { setValueEnumData } from '../../Router/MenuBoxList'

export const ProjectFormItemValue = async ({ upDataEvent, data, Permission }) => {
    const SceneList = await setValueEnumData({ url: 'getScenes' })
    const ProjectRegion = await setValueEnumData({ url: 'getProjectRegion' })

    let dataList = {
        uuid: data.uuid,
        type: '项目配置',
        hideInSearch: true,
        pageSize: 10,
        SceneList,
        ProjectRegion,
        params: { OrganizationUuid: data.uuid },
        classification: 'FieldConfiguration',
        get: API_LIST([data.uuid])['getProjectFormItemValueListWithValue'],
        option: [
            Permission.findIndex(v => v.uuid === '01be0b8d-4513-49d8-bae1-4c2719985dd5') !== -1 && (
                <TwoAddBtn
                    key="getField"
                    upDataEvent={upDataEvent}
                    title="编辑字段"
                    ThrKey="ThrModal"
                    value="ProjectFormItemValue"
                    data={data}
                />
            ),
        ],
    }
    return dataList
}
